package com.ftg.mall.mapper.pms;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ftg.mall.base.entity.pms.SkuStock;
import io.swagger.annotations.ApiParam;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * sku的库存 Mapper 接口
 * </p>
 *
 * @author wangty
 * @since 2022-11-17
 */
@Mapper
public interface SkuStockMapper extends BaseMapper<SkuStock> {

    /**
     * 添加库存
     * @param productId
     * @return
     */
    @Insert("insert into pms_sku_stock(product_id,stock) values(#{product_id},#{stock} )")
    List<SkuStock> insertSku(
            @RequestBody SkuStock skuStock,
            @RequestParam("product_id")@ApiParam("商品编号") Long productId );

}
